const driver = window.driver.js.driver;

const driverObj = driver({
    prevBtnText: '上一个',
    nextBtnText: '下一个',
    doneBtnText: '完成',
    showProgress: true,
    steps: [
        {
            element: '.rungame',
            popover: {side: 'top', title: '点击开始游戏', description: '点击空格或鼠标左键可以跳过障碍物'}
        },
        {element: '.cj1', popover: {title: '切换游戏场景', description: '点击可切换游戏场景'}},
        {element: '.cj2', popover: {title: '切换游戏场景', description: '点击可切换游戏场景'}},
        {element: '.resetgame', popover: {title: '重新开始游戏', description: '点击可重新开始游戏'}},
        {element: '.jj', popover: {title: '讲解视频', description: '点击可跳转至讲解视频'}},
        {element: '.ck', popover: {title: 'Gitee仓库', description: '点击可跳转至代码仓库'}},
    ]
})
driverObj.drive();
// driverObj.highlight(
//     {
//         showProgress: true,
//         element: ".rungame",
//         popover: {
//             side: "bottom",
//             title: "点击开始游戏",
//             description: "点击空格或鼠标左键可以跳过障碍物",
//         }
//     }
// );

// 点击开始游戏后关闭引导界面
document.querySelector('.rungame').addEventListener('click', function () {
    driverObj.destroy();
})

